<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-分类导航','%mfile%datepicker')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('分类导航管理（支持删除操作，不支持修改操作）')"></div>
        <div th:replace="common/search::search('%add')"></div>
    </div>
</div>

<!--添加Nav模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">分类导航添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd(this)">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">导航类别*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="ntype" id="ntype"
                                                            onchange="ntypeChange()">
                                                        <option th:if="${isAdmin} ne '1'" value="1">商品分类</option>
                                                        <option value="2">功能模块</option>
                                                        <option value="3">商家分类</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">排序</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="sort" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="systemGC">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">导航名称*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select onchange="gcsel(this.value)" class="form-control select2"
                                                            name="gcsel" id="gcsel">
                                                        <option th:each="c:${gclist}" th:value="${c.pic}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">
                                                </label>
                                                <div class="col-sm-8">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="systemNav" style="display: none">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">导航名称*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="navsel" id="navsel">
                                                        <option th:each="c:${list}" th:value="${c.nvalue+c.pic}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">
                                                </label>
                                                <div class="col-sm-8">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="hangyeNav" style="display: none">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">导航名称*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="hangyesel"
                                                            id="hangyesel">
                                                        <option th:each="c:${hylist}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">
                                                </label>
                                                <div class="col-sm-8">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="selfNav" style="display: none">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">导航名称*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="name" id="name"
                                                           required type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">分类值*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="nvalue" id="nvalue"
                                                           required type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否自定义图标</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isSelfIcon" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">启用状态</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="systemRow" style="display: none">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否系统级别</label>
                                                <div class="col-sm-8">
                                                    <input type="hidden" name="isSystem" value="" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="jiancheRow" style="display: none">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">一字简称</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" type="text" name="jianchen" value=""
                                                           maxlength="1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="selfRow" style="display: none">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">导航图片
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--设置行业分类-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">修改分类导航</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">名称*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="name2" name="name"
                                                           required type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">导航值*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="nvalue2" name="nvalue"
                                                           required type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">行业分类图标</label>
                                                <div class="col-sm-10">
                                                    <input id="mfilepic" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidid" name="id" type="hidden" value="" />
                                    <input id="hidpic2" name="pic" type="hidden" value="" />
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<input id="isAdmin" type="hidden" th:value="${isAdmin}"/>
<input id="msg" type="hidden" th:value="${msg}"/>

<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/nav.js"></script>
</body>
</html>
